package cn.mingfancloud.基础知识.字符串;

public class CharSequenceConversion {
    public static void main(String[] args) {
        String str = "String";
        // String转换成StringBuffer
        StringBuffer sbf = new StringBuffer(str);
        // String转换成StringBuilder
        StringBuilder sbd = new StringBuilder(str);
        // StringBuffer转换成String
        str = sbf.toString();
        // StringBuilder转换成String
        str = sbd.toString();
        // StringBuffer转换成StringBuilder
        StringBuilder bufferToBuilder = new StringBuilder(sbf.toString());
        // StringBuilder转换成StringBuffer
        StringBuffer builderToBuffer = new StringBuffer(sbd.toString());
    }
}
